//
//  RenderPage.m
//  ModuleTesting
//
//  Created by duc nguyen van on 8/30/11.
//  Copyright 2011 STU. All rights reserved.
//

#import "RenderPage.h"


@implementation RenderPage
@synthesize shapes;

#pragma mark -
#pragma mark delegateShapeView

-(void)setSelectedShape:(id)sp{
	selectingShape.reView.hidden = YES;
	selectingShape = sp;
	selectingShape.reView.hidden = NO;
}

#pragma mark -
#pragma mark delegateView

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
	NSLog(@"has cheked!");
	selectingShape.reView.hidden = YES;
}

#pragma mark -
#pragma mark init

- (id)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code.
		shapes = [[NSMutableArray alloc] init];
    }
    return self;
}

-(void)renderWithChoosingPage:(int)page{
	ActorOneView *actorOne;
	ActorTwoView *actorTwo;
	switch (page) {
		case 1:
			actorOne = [[ActorOneView alloc] initWithDefaultImage];
			actorOne.backgroundColor = [UIColor clearColor];
			actorOne.center = self.center;
			actorOne.delegate = self;
			[self addSubview:actorOne];
			[actorOne release];
			break;
			
		case 2:
			actorTwo = [[ActorTwoView alloc] initWithDefaultImage];
			actorTwo.backgroundColor = [UIColor clearColor];
			actorTwo.center = self.center;
			actorTwo.delegate = self;
			[self addSubview:actorTwo];
			[actorTwo release];
			break;

		default:
			break;
	}
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code.
}
*/

- (void)dealloc {
    [super dealloc];
}


@end
